In many software systems today, the existing or legacy graphical user interfaces (“GUIs”) are coded in C++. Over the past few years, however, Java® has become the programming language of choice. In order to use Java for providing the functionality of a system, the C++ GUIs must be made useable with Java. One alternative is to rewrite all of the lines of C++ code in Java. Rewriting the C++ code may comprise rewriting many lines of code. In many situations this is impractical. Furthermore, in many situations, it is desirable to maintain the C++ GUIs, instead of replacing them, and to use them to interface Java objects and methods of the Java functional code.
However, although generally an object-oriented language, C++ is a procedural language in that it can implement procedural interfaces while Java is an object-oriented language. Object-oriented programming is a method of programming that pairs programming tasks and data into re-usable chunks known as objects. Each object comprises attributes (i.e., data) that define and describe the object. Java classes are meta-definitions that define the structure of a Java object. Java classes when instantiated create instances of the Java classes and are then considered Java objects. Methods within Java objects are called to get or set attributes of the Java object and to change the state of the Java object. Associated with each method is code that is executed when the method is invoked.
A task that is a sequence of steps in a C++ implementation likely involves the creation and/or manipulation of multiple objects in a Java implementation. Moreover, some tasks may require a remote method invocation (“RMI”). Unfortunately, coding Java object-creation or RMIs in C++ can be quite cumbersome. If C++ GUIs are maintained for accessing a Java implementation, the cumbersome coding of the tasks involving Java object-creation and RMIs will clutter the C++ GUIs.
A solution to this problem would simplify the C++ GUI code by having Java object creation occur in Java. A solution would simplify access to first-class objects of the Java implementation and provide a simple access to RMIs. A solution would allow simple C++ GUI callback code for creating and accessing Java objects.